export const serialize = (data:any)=>{
    return Object.keys(data).map(key=>`${key}=${data[key]}`).join('&');
}

export const  jsonToFormData = (data:any)=>{
    const formData = new FormData()
    Object.keys(data).forEach(key=>{
        let value = data[key];
        if(value&&value.file){
            value = value.file
        } 
        else if(typeof value==='object'&&!(value instanceof File)){
            value = JSON.stringify(value)
        }
        if(value!==undefined){

            formData.append(key,value)
        }
    })
 return formData
}
// const ContentType = {

// }
// export const  